home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 3.9 KB | 142 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: ShpTrakr.h
- // Release Version: $ 1.0d11 $
- //
- // Author: Henri Lamiraux
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef SHPTRAKR_H
- #define SHPTRAKR_H
-
- // ----- Part Layer -----
-
- #ifndef FWTRACKR_H
- #include "FWTrackr.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWINK_H
- #include "FWInk.h"
- #endif
-
- #ifndef FWSTYLE_H
- #include "FWStyle.h"
- #endif
-
- //========================================================================================
- // Forward class declarations
- //========================================================================================
-
- class FW_CLASS_ATTR CBaseShape;
-
- //========================================================================================
- // class CShapeTracker
- //========================================================================================
-
- class FW_CLASS_ATTR CShapeTracker : public FW_CTracker
- {
- //----------------------------------------------------------------------------------------
- // Constructor/Destructor
- //
- public:
- CShapeTracker(Environment* ev,
- FW_CView* view,
- ODFacet* facet,
- CBaseShape* theShape,
- FW_Boolean gridOn);
- virtual ~CShapeTracker();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_CPoint BeginTracking(Environment* ev,
- const FW_CPoint& anchorPoint);
- virtual FW_CPoint ContinueTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& previousPoint,
- const FW_CPoint& currentPoint);
- virtual FW_Boolean EndTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& lastPoint);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- protected:
- void ForceToGrid(Environment* ev, FW_CPoint& point);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CBaseShape* fShape;
- FW_Boolean fErase;
- FW_Boolean fGridOn;
- };
-
- //========================================================================================
- // class CResizeTracker
- //========================================================================================
-
- class FW_CLASS_ATTR CResizeTracker : public FW_CTracker
- {
- //----------------------------------------------------------------------------------------
- // Constructor/Destructor
- //
- public:
- CResizeTracker(Environment* ev,
- FW_CView* view, ODFacet* facet,
- CBaseShape* theShape, short whichHandle,
- const FW_PInk& resizeInk, const FW_PStyle& resizeStyle,
- FW_Boolean gridOn);
- virtual ~CResizeTracker();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_CPoint BeginTracking(Environment* ev,
- const FW_CPoint& anchorPoint);
- virtual FW_CPoint ContinueTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& previousPoint,
- const FW_CPoint& currentPoint);
- virtual FW_Boolean EndTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& lastPoint);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void GetLastLocation(FW_CPoint& lastLocation)
- {lastLocation = fLastLocation;}
-
- private:
- void ForceToGrid(Environment* ev, FW_CPoint& point);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CBaseShape* fShape;
- short fWhichHandle;
- FW_Boolean fErase;
- FW_PInk fResizeInk;
- FW_PStyle fResizeStyle;
- FW_CPoint fDelta;
- FW_Boolean fGridOn;
- FW_CPoint fLastLocation;
- };
-
- #endif